#!/bin/bash
if egrep -c 'Red Hat|EulerOS' /proc/version; then   # CentOS7|RHEL7|EulerOS
    tcpESTAB=$(ss -an |grep -c 'tcp.*ESTAB')
elif grep -c SUSE /proc/version ;then   # SUSE11
    tcpESTAB=$(ss -an |grep -c '^ESTAB')
else
    tcpESTAB=0
fi &> /dev/null

echo ${tcpESTAB};
